//
//  main.m
//  Protocol协议应用场景2-代理设计模式
//
//  Created by wenjim on 17/10/20.
//  Copyright © 2017年 WenJim. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "Baby.h"
#import "Nanny.h"
#import "Student.h"
#import "Teacher.h"

int main(int argc, const char * argv[]) {
    
    // 1.创建婴儿
    Baby * baby = [[Baby alloc] init];
    
    // 2.创建保姆
//    Nanny * nanny = [[Nanny alloc] init];
//    // 3.将保姆赋值给婴儿
//    baby.nanny = nanny;
    
//    // 4.换保姆
    Student * s = [[Student alloc] init];
    
    baby.nanny = s;
    
    
    // 5. 再次换保姆
    Teacher * t = [[Teacher alloc] init];
    baby.nanny = t;
    
    // 婴儿的活动
    [baby food];
    [baby sleepy];
    
    return 0;
}
